﻿/**********************************************************************
 * @file   GUIGeometryLineDialog.h
 * @brief  几何创建线界面类
 * @author yangjing (1195810980@qq.com)
 * @date   2025-02-20
 *********************************************************************/
#ifndef __GUIGEOMETRYLINEDIALOG_H__
#define __GUIGEOMETRYLINEDIALOG_H__
#include <array>

#include "GUIGeometryBaseDialog.h"

namespace Ui { class GUIGeometryLineDialog; }
namespace Interface
{
    class FITKAbsGeoModelSegment;
}
namespace GUI {
    /**
    * @brief 创建几何线窗口
    * @author yangjing (1195810980@qq.com)
    * @date 2025-02-20
    */
    class GUIGeometryDialogAPI GUIGeometryLineDialog : public GUIGeometryBaseDialog
    {
        Q_OBJECT

    public:
        /**
        * @brief 创建的构造函数
        * @param[i]  oper           operators
        * @author yangjing (1195810980@qq.com)
        * @date 2025-02-11
        */
        GUIGeometryLineDialog(Core::FITKActionOperator* oper, QWidget* parent = nullptr);
        /**
         * @brief 编辑的构造函数
         * @param[i]  obj            My Param doc
         * @param[i]  oper           My Param doc
         * @author yangjing (1195810980@qq.com)
         * @date 2025-02-11
         */
        GUIGeometryLineDialog(Interface::FITKAbsGeoModelSegment* obj, Core::FITKActionOperator* oper, QWidget* parent = nullptr);
        /**
         * @brief 析构函数
         * @author yangjing (1195810980@qq.com)
         * @date 2025-02-11
         */
        ~GUIGeometryLineDialog();
        /**
         * @brief init
         * @author yangjing (1195810980@qq.com)
         * @date 2025-02-11
         */
        void init() override;

    private:
        /**
        * @brief    获取设置的名称
        * @return   QString
         * @author yangjing (1195810980@qq.com)
         * @date 2025-02-11
        */
        QString getNameText() override;

        /**
        * @brief    拾取完成操作器,点击后，触发
        * @return   void
         * @author yangjing (1195810980@qq.com)
         * @date 2025-02-11
        */
        virtual void pickFinishedOper() override;


        /**
         * @brief 从界面获取数据，更新到数据对象中
         * @author yangjing (1195810980@qq.com)
         * @date 2025-02-11
         */
        virtual void getDataFormWidget()override;
    private slots:
        /**
        * @brief 点1选取按钮响应
        * @author yangjing (1195810980@qq.com)
        * @date 2025-02-11
        */
        void on_pushButtonPoint1_Pick_clicked();

        /**
        * @brief 点2选取按钮响应
        * @author yangjing (1195810980@qq.com)
        * @date 2025-02-11
        */
        void on_pushButtonPoint1_Pick_2_clicked();


        /**
        * @brief确认按钮响应
        * @author yangjing (1195810980@qq.com)
        * @date 2025-02-11
        */
        void on_pushButton_OK_clicked();

        /**
        * @brief    取消按钮响应
        * @return   void
        * @author yangjing (1195810980@qq.com)
        * @date 2025-02-19
        */
        void on_pushButton_Cancel_clicked();


    private:
        /**
        * @brief传入ID，获取该点的xyz数据
        * @author yangjing (1195810980@qq.com)
        * @date 2025-02-11
        */
        std::array<double, 3>getPointXYZ(int id);

        /**
        * @brief检查选择的点数据是否正确
        * @author yangjing (1195810980@qq.com)
        * @date 2025-02-11
        */
        bool checkArgc();
    private:

        
        int m_Pick = -1;//用于控制当前是起点还是终点的模型选择

        Ui::GUIGeometryLineDialog *_ui = nullptr;
    };
}
#endif // GUIGEOMETRYLINEDIALOG_H

